import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [

  {
    path: '/',
    name: 'admin',
    component: () => import('../views/Admin.vue'),
    redirect: '/studentlist',//重定向到默认地址
    children:[
      {
      path:'studentlist',
      component:()=>import('../views/StudenList.vue')
      },
      {
        path:'studentadd',
        component:()=>import('../views/StudentAdd.vue')
      },
      {
        path:'teacherlist',
        component:()=>import('../views/TeacherList.vue')
      },
      {
        path:'teacheradd',
        component:()=>import('../views/TeacherAdd.vue')
      },
      {
        path:'courselist',
        component:()=>import('../views/CourseList.vue')
      },
      {
        path:'courseadd',
        component:()=>import('../views/CourseAdd.vue')
      },
      {
        path:'orders',
        component:()=>import('../views/Orders.vue')
      },
    ]
  },


]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
